

Ext.define('docList', {
    extend: 'Ext.data.Model',
    fields: [
 	 		{name: 'document', mapping: 'document'},
	 	    {name:'revision', mapping: 'revision' },
	 	    {name: 'aglieDocNum', mapping: 'aglieDocNum'},
	 	    {name:'type',mapping:'type'},
	 	    {name: 'description', mapping: 'description'},
	 	   	{name: 'agileChangeNum', mapping: 'agileChangeNum'},
	 	   	{name: 'agileDeviationNum', mapping: 'agileDeviationNum'},
	 	   	{name: 'releaseDate', mapping: 'releaseDate'},
	 	   	{name: 'effectiveDate', mapping: 'effectiveDate'},
	 	   	{name: 'mark', mapping: 'mark'},
	 	  	{name: 'effectiveFrom', mapping: 'effectiveFrom'},
	 	   	{name: 'effectiveTo', mapping: 'effectiveTo'},
	 	    {name: 'partNumber', mapping: 'partNumber'},
	 	   	{name: 'quantity', mapping: 'quantity'},
	 	  	{name: 'deviationType', mapping: 'deviationType'}
    ]
});


var docListStore = Ext.create('Ext.data.Store', {
    pageSize: 10,
    model: 'docList',
    proxy: {
        type: 'ajax',
        url:'',
        timeout: 1200000, 
        reader: {
        	type: 'json',
        	root: 'docList',
        	totalProperty: 'docTotalCount',
        },
        afterRequest: function(request, success) { 
        	hidenLoad(mainFormMask);
        }
    },
    listeners:{
    },
    sorters: [{
        property: 'agileDeviationNum',
        direction: 'DESC'
    },{
        property: 'releaseDate',
        direction: 'DESC'
    }]
	});

var panel2Column1 = [{
		header:'Document',
		sortable:true,
		dataIndex:'document',
		width:262,
},{
	header:'Type',
	sortable:true,
	flex:1,
	width:80,
	dataIndex:'type',
},{
	header:'Description',
	sortable:true,
	flex:1,
	hidden:true,
	dataIndex:'description',
}];

var panel2Column2 = [{
	header:'Document',
	sortable:true,
	dataIndex:'document',
	width:262,
	},{
	header:'Revision',
	sortable:true,
	dataIndex:'revision',
	width:60,
	},{
	header:'AglieDocNum',
	sortable:true,
	dataIndex:'aglieDocNum',
	width:260,
	},{
	header:'Description',
	sortable:true,
	flex:1,
	dataIndex:'description',
}];

var panel2Column3 = [{
    header: '',
    dataIndex: 'mark', 
    width: 30, 
    align: 'center'
    // renderer: <portlet:namespace />showdisable
    },{
	header:'Document',
	sortable:true,
	dataIndex:'document',
	width:130
	// renderer: <portlet:namespace />changecolor
	},{
	header:'Revision',
	sortable:true,
	dataIndex:'revision',
	width:70
	// renderer: <portlet:namespace />changecolor
	},{
	header:'AglieDocNum',
	sortable:true,
	dataIndex:'aglieDocNum',
	width:120
	// renderer: <portlet:namespace />changecolor
	//renderer: <portlet:namespace />showhidden
	},{
	header:'AgileChangeNum',
	sortable:true,
	//flex:1,
	width:40,
	dataIndex:'agileChangeNum'
	// renderer: <portlet:namespace />changecolor
	//renderer: <portlet:namespace />showhidden
	},{
	header:'AgileDeviationNum',
	sortable:true,
	//flex:1,
	width:120,
	dataIndex:'agileDeviationNum'
	// renderer: <portlet:namespace />changecolor
	},{
		header:'DeviationType',
		sortable:true,
		//flex:1,
		width:80,
		dataIndex:'deviationType'
		// renderer: <portlet:namespace />changecolor
	},{	
	header:'ActiveDate',
	sortable:true,
	//flex:1,
	width:150,
	dataIndex:'releaseDate'
	// renderer: <portlet:namespace />changecolor
	//renderer: <portlet:namespace />showhidden
	},{
	header:'EffectiveFromDate',
	sortable:true,
	//flex:1,
	width:150,
	dataIndex:'effectiveFrom'
	// renderer: <portlet:namespace />changecolor
	//renderer: <portlet:namespace />showhidden
	},{
	header:'EffectiveToDate',
	sortable:true,
	//flex:1,
	width:150,
	dataIndex:'effectiveTo'
	// renderer: <portlet:namespace />changecolor
	//renderer: <portlet:namespace />showhidden
	},{
	header:'Description',
	sortable:true,
	flex:1,
	width:70,
	dataIndex:'description'
	// renderer: <portlet:namespace />changecolor
	//renderer: <portlet:namespace />showhidden
	}];

Ext.define('DocMap.view.Panel_02',{
	extend: "Ext.grid.Panel",
	region:'center',
 	loadMask: true,
 	id: 'panel_02',
 	alias:'widget.panel_02',
	height: 143,
	store:docListStore,
	title:"2 Agile Document List",
 	// selModel: testSm,
	anchor:"100%",
	columns:panel2Column2,
	listeners:{

	},
	bbar: [{
		xtype:'pagingtoolbar',
		dock: 'bottom',
		store:docListStore
	}]
});